package com.lemobar.pay.model.wxpay.response;

import lombok.Data;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;


/**
 * 微信 退款查询 请求
 * JSAPI https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_5
 * APP支付 https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_5&index=7
 * 小程序支付 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_5
 * 付款码支付 https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_5
 */
@Data
@Root(name = "xml", strict = false)
public class WxPayRefundQueryResponse {

    /**
     * 返回状态码
     * SUCCESS/FAIL
     */
    @Element(name = "return_code")
    private String returnCode;

    /**
     * 返回信息
     * 当return_code为FAIL时返回信息为错误原因
     */
    @Element(name = "return_msg")
    private String returnMsg;

    /* 以下字段在return_code为SUCCESS的时候有返回. */

    @Element(name = "result_code", required = false)
    private String resultCode;

    @Element(name = "err_code", required = false)
    private String errCode;

    @Element(name = "err_code_des", required = false)
    private String errCodeDes;

    @Element(name = "appid", required = false)
    private String appid;

    @Element(name = "mch_id", required = false)
    private String mchId;

    @Element(name = "nonce_str", required = false)
    private String nonceStr;

    @Element(name = "sign", required = false)
    private String sign;

    @Element(name = "total_refund_count", required = false)
    private Integer totalRefundCount;

    @Element(name = "transaction_id", required = false)
    private String transactionId;

    @Element(name = "out_trade_no", required = false)
    private String outTradeNo;

    /**
     * 订单总金额，单位为分
     */
    @Element(name = "total_fee", required = false)
    private Integer totalFee;

    @Element(name = "settlement_total_fee", required = false)
    private Integer settlementTotalFee;

    @Element(name = "fee_type", required = false)
    private String feeType;


    /**
     * 现金支付金额，单位为分
     */
    @Element(name = "cash_fee", required = false)
    private Integer cashFee;

    /**
     * 退款笔数
     */
    @Element(name = "refund_count", required = false)
    private Integer refundCount;


    /**
     * 商户退款单号
     */
    //@Element(name = "out_refund_no_$n", required = false)
    //private String outRefundNo$n;
    @Element(name = "out_refund_no_0", required = false)
    private String outRefundNo0;
    @Element(name = "out_refund_no_1", required = false)
    private String outRefundNo1;
    @Element(name = "out_refund_no_2", required = false)
    private String outRefundNo2;
    @Element(name = "out_refund_no_3", required = false)
    private String outRefundNo3;
    @Element(name = "out_refund_no_4", required = false)
    private String outRefundNo4;
    @Element(name = "out_refund_no_5", required = false)
    private String outRefundNo5;
    @Element(name = "out_refund_no_6", required = false)
    private String outRefundNo6;
    @Element(name = "out_refund_no_7", required = false)
    private String outRefundNo7;
    @Element(name = "out_refund_no_8", required = false)
    private String outRefundNo8;
    @Element(name = "out_refund_no_9", required = false)
    private String outRefundNo9;

    /**
     * 微信退款单号
     */
    //@Element(name = "refund_id_$n", required = false)
    //private String refundId$n;
    @Element(name = "refund_id_0", required = false)
    private String refundId0;
    @Element(name = "refund_id_1", required = false)
    private String refundId1;
    @Element(name = "refund_id_2", required = false)
    private String refundId2;
    @Element(name = "refund_id_3", required = false)
    private String refundId3;
    @Element(name = "refund_id_4", required = false)
    private String refundId4;
    @Element(name = "refund_id_5", required = false)
    private String refundId5;
    @Element(name = "refund_id_6", required = false)
    private String refundId6;
    @Element(name = "refund_id_7", required = false)
    private String refundId7;
    @Element(name = "refund_id_8", required = false)
    private String refundId8;
    @Element(name = "refund_id_9", required = false)
    private String refundId9;

    /**
     * 退款渠道
     * ORIGINAL—原路退款
     * BALANCE—退回到余额
     * OTHER_BALANCE—原账户异常退到其他余额账户
     * OTHER_BANKCARD—原银行卡异常退到其他银行卡
     */
    //@Element(name = "refund_channel_$n", required = false)
    //private String refundChannel$n;
    @Element(name = "refund_channel_0", required = false)
    private String refundChannel0;
    @Element(name = "refund_channel_1", required = false)
    private String refundChannel1;
    @Element(name = "refund_channel_2", required = false)
    private String refundChannel2;
    @Element(name = "refund_channel_3", required = false)
    private String refundChannel3;
    @Element(name = "refund_channel_4", required = false)
    private String refundChannel4;
    @Element(name = "refund_channel_5", required = false)
    private String refundChannel5;
    @Element(name = "refund_channel_6", required = false)
    private String refundChannel6;
    @Element(name = "refund_channel_7", required = false)
    private String refundChannel7;
    @Element(name = "refund_channel_8", required = false)
    private String refundChannel8;
    @Element(name = "refund_channel_9", required = false)
    private String refundChannel9;


    /**
     * 申请退款金额
     * 退款总金额,单位为分
     */
    //@Element(name = "refund_fee_$n", required = false)
    //private Integer refundFee$n;
    @Element(name = "refund_fee_0", required = false)
    private Integer refundFee0;
    @Element(name = "refund_fee_1", required = false)
    private Integer refundFee1;
    @Element(name = "refund_fee_2", required = false)
    private Integer refundFee2;
    @Element(name = "refund_fee_3", required = false)
    private Integer refundFee3;
    @Element(name = "refund_fee_4", required = false)
    private Integer refundFee4;
    @Element(name = "refund_fee_5", required = false)
    private Integer refundFee5;
    @Element(name = "refund_fee_6", required = false)
    private Integer refundFee6;
    @Element(name = "refund_fee_7", required = false)
    private Integer refundFee7;
    @Element(name = "refund_fee_8", required = false)
    private Integer refundFee8;
    @Element(name = "refund_fee_9", required = false)
    private Integer refundFee9;


    /**
     * 退款金额
     */
    //@Element(name = "settlement_refund_fee_$n", required = false)
    //private Integer settlementRefundFee$n;
    @Element(name = "settlement_refund_fee_0", required = false)
    private Integer settlementRefundFee0;
    @Element(name = "settlement_refund_fee_1", required = false)
    private Integer settlementRefundFee1;
    @Element(name = "settlement_refund_fee_2", required = false)
    private Integer settlementRefundFee2;
    @Element(name = "settlement_refund_fee_3", required = false)
    private Integer settlementRefundFee3;
    @Element(name = "settlement_refund_fee_4", required = false)
    private Integer settlementRefundFee4;
    @Element(name = "settlement_refund_fee_5", required = false)
    private Integer settlementRefundFee5;
    @Element(name = "settlement_refund_fee_6", required = false)
    private Integer settlementRefundFee6;
    @Element(name = "settlement_refund_fee_7", required = false)
    private Integer settlementRefundFee7;
    @Element(name = "settlement_refund_fee_8", required = false)
    private Integer settlementRefundFee8;
    @Element(name = "settlement_refund_fee_9", required = false)
    private Integer settlementRefundFee9;

    /**
     * 代金券类型
     */
    //@Element(name = "coupon_type_$n_$m", required = false)
    //private String couponType$n$m;

    /**
     * 总代金券退款金额
     */
    //@Element(name = "coupon_refund_fee_$n", required = false)
    //private Integer couponRefundFee$n;

    /**
     * 退款代金券使用数量
     */
    //@Element(name = "coupon_refund_count_$n", required = false)
    //private Integer couponRefundCount$n;


    /**
     * 退款代金券使用数量
     */
    //@Element(name = "coupon_refund_id_$n_$m", required = false)
    //private String couponRefundId$n$m;

    /**
     * 单个代金券退款金额
     */
    //@Element(name = "coupon_refund_fee_$n_$m", required = false)
    //private Integer couponRefundFee$n$m;

    /**
     * 退款状态
     * SUCCESS—退款成功
     * REFUNDCLOSE—退款关闭，指商户发起退款失败的情况。
     * PROCESSING—退款处理中
     * CHANGE—退款异常，退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败，可前往商户平台（pay.weixin.qq.com）-交易中心，手动处理此笔退款。$n为下标，从0开始编号。
     */
    //@Element(name = "refund_status_$n", required = false)
    //private String refundStatus$n;
    @Element(name = "refund_status_0", required = false)
    private String refundStatus0;
    @Element(name = "refund_status_1", required = false)
    private String refundStatus1;
    @Element(name = "refund_status_2", required = false)
    private String refundStatus2;
    @Element(name = "refund_status_3", required = false)
    private String refundStatus3;
    @Element(name = "refund_status_4", required = false)
    private String refundStatus4;
    @Element(name = "refund_status_5", required = false)
    private String refundStatus5;
    @Element(name = "refund_status_6", required = false)
    private String refundStatus6;
    @Element(name = "refund_status_7", required = false)
    private String refundStatus7;
    @Element(name = "refund_status_8", required = false)
    private String refundStatus8;
    @Element(name = "refund_status_9", required = false)
    private String refundStatus9;

    /**
     * 退款资金来源
     */
    //@Element(name = "refund_account_$n", required = false)
    //private String refundAccount$n;
    @Element(name = "refund_account_0", required = false)
    private String refundAccount0;
    @Element(name = "refund_account_1", required = false)
    private String refundAccount1;
    @Element(name = "refund_account_2", required = false)
    private String refundAccount2;
    @Element(name = "refund_account_3", required = false)
    private String refundAccount3;
    @Element(name = "refund_account_4", required = false)
    private String refundAccount4;
    @Element(name = "refund_account_5", required = false)
    private String refundAccount5;
    @Element(name = "refund_account_6", required = false)
    private String refundAccount6;
    @Element(name = "refund_account_7", required = false)
    private String refundAccount7;
    @Element(name = "refund_account_8", required = false)
    private String refundAccount8;
    @Element(name = "refund_account_9", required = false)
    private String refundAccount9;

    /**
     * 退款入账账户
     */
    //@Element(name = "refund_recv_accout_$n", required = false)
    //private String refundRecvAccout$n;
    @Element(name = "refund_recv_accout_0", required = false)
    private String refundRecvAccout0;
    @Element(name = "refund_recv_accout_1", required = false)
    private String refundRecvAccout1;
    @Element(name = "refund_recv_accout_2", required = false)
    private String refundRecvAccout2;
    @Element(name = "refund_recv_accout_3", required = false)
    private String refundRecvAccout3;
    @Element(name = "refund_recv_accout_4", required = false)
    private String refundRecvAccout4;
    @Element(name = "refund_recv_accout_5", required = false)
    private String refundRecvAccout5;
    @Element(name = "refund_recv_accout_6", required = false)
    private String refundRecvAccout6;
    @Element(name = "refund_recv_accout_7", required = false)
    private String refundRecvAccout7;
    @Element(name = "refund_recv_accout_8", required = false)
    private String refundRecvAccout8;
    @Element(name = "refund_recv_accout_9", required = false)
    private String refundRecvAccout9;

    /**
     * 退款成功时间
     */
    //@Element(name = "refund_success_time_$n", required = false)
    //private String refundSuccessTime$n;
    @Element(name = "refund_success_time_0", required = false)
    private String refundSuccessTime0;
    @Element(name = "refund_success_time_1", required = false)
    private String refundSuccessTime1;
    @Element(name = "refund_success_time_2", required = false)
    private String refundSuccessTime2;
    @Element(name = "refund_success_time_3", required = false)
    private String refundSuccessTime3;
    @Element(name = "refund_success_time_4", required = false)
    private String refundSuccessTime4;
    @Element(name = "refund_success_time_5", required = false)
    private String refundSuccessTime5;
    @Element(name = "refund_success_time_6", required = false)
    private String refundSuccessTime6;
    @Element(name = "refund_success_time_7", required = false)
    private String refundSuccessTime7;
    @Element(name = "refund_success_time_8", required = false)
    private String refundSuccessTime8;
    @Element(name = "refund_success_time_9", required = false)
    private String refundSuccessTime9;


}
